package com.codegeek.project.slope.service.impl;

import com.codegeek.project.slope.domain.SlopeMonitorItem;
import com.codegeek.project.slope.mapper.SlopeMonitorItemMapper;
import com.codegeek.project.slope.service.ISlopeMonitorItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 监测项Service业务层处理
 *
 * @author codegeek
 * @date 2020-02-17
 */
@Service
public class SlopeMonitorItemServiceImpl implements ISlopeMonitorItemService {
    @Autowired
    private SlopeMonitorItemMapper slopeMonitorItemMapper;

    /**
     * 查询监测项
     *
     * @param itemId 监测项ID
     * @return 监测项
     */
    @Override
    public SlopeMonitorItem selectSlopeMonitorItemById(Long itemId) {
        return slopeMonitorItemMapper.selectSlopeMonitorItemById(itemId);
    }

    /**
     * 查询监测项列表
     *
     * @param slopeMonitorItem 监测项
     * @return 监测项
     */
    @Override
    public List<SlopeMonitorItem> selectSlopeMonitorItemList(SlopeMonitorItem slopeMonitorItem) {
        return slopeMonitorItemMapper.selectSlopeMonitorItemList(slopeMonitorItem);
    }

    /**
     * 新增监测项
     *
     * @param slopeMonitorItem 监测项
     * @return 结果
     */
    @Override
    public int insertSlopeMonitorItem(SlopeMonitorItem slopeMonitorItem) {
        return slopeMonitorItemMapper.insertSlopeMonitorItem(slopeMonitorItem);
    }

    /**
     * 修改监测项
     *
     * @param slopeMonitorItem 监测项
     * @return 结果
     */
    @Override
    public int updateSlopeMonitorItem(SlopeMonitorItem slopeMonitorItem) {
        return slopeMonitorItemMapper.updateSlopeMonitorItem(slopeMonitorItem);
    }

    /**
     * 批量删除监测项
     *
     * @param itemIds 需要删除的监测项ID
     * @return 结果
     */
    @Override
    public int deleteSlopeMonitorItemByIds(Long[] itemIds) {
        return slopeMonitorItemMapper.deleteSlopeMonitorItemByIds(itemIds);
    }

    /**
     * 删除监测项信息
     *
     * @param itemId 监测项ID
     * @return 结果
     */
    @Override
    public int deleteSlopeMonitorItemById(Long itemId) {
        return slopeMonitorItemMapper.deleteSlopeMonitorItemById(itemId);
    }
}
